<?php

namespace App\Repositories\MoneyCard;

use Prettus\Repository\Eloquent\BaseRepository;
use Prettus\Repository\Criteria\RequestCriteria;
use App\Repositories\MoneyCard\CardCouponsClassRepository;
use App\Models\MoneyCard\CardCouponsClass;

/**
 * 卡券类型信息
 * Class CardCouponsClassRepositoryEloquent
 * @package namespace App\Repositories\MoneyCard;
 */
class CardCouponsClassRepositoryEloquent extends BaseRepository implements CardCouponsClassRepository
{
    /**
     * Specify Model class name
     *
     * @return string
     */
    public function model()
    {
        return CardCouponsClass::class;
    }


    /**
     * 获取卡券分类信息
     * @param int $classId
     * @return mixed
     */
    public function getCardCouponsClassInfo(int $classId){
        return $this->find($classId,['name','price','is_vip','astrict','up_vip','is_gift']);
    }

    /**
     * Boot up the repository, pushing criteria
     */
    public function boot()
    {
        $this->pushCriteria(app(RequestCriteria::class));
    }
}
